<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>Struts2练习</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<h1>计算器</h1>
	<s:form action="calculate">
		<s:textfield name="calculate.num1" label="First Number"></s:textfield>
		<s:textfield name="calculate.num2" label="Second Number"></s:textfield>
		<s:submit value="Caculate"></s:submit>
		<br />
	</s:form>
	<h3>
		<s:label label="result"></s:label>
		<span id="result">
			<s:property value="calculate.result" />
		</span>
	</h3>
	<h1>计算记录</h1>
	<s:iterator value="#session.history" var="calc">
		<s:property value="#calc.num1"/>的
		<s:property value="#calc.num2"/>次方是
		<s:property value="#calc.result"/>
		计算时间:
		<s:property value="time"/>
	</s:iterator>
</body>
</html>
